<?php
class guestbookController extends Controller{
    public static function _right(){
        return array(
            array('广告管理'),
            array('广告添加','add,add_'),
            array('广告列表','mylist'),
            array('广告编辑','mod,mod_'),
            array('广告删除','del'),
            array('静态生成','html,html_'),
            array('批量操作','bit_op'),
        );
    }
	public function __construct(){
		parent::__construct();
		
	}
	public function s(){
		return array('guestbook');
	}
	
	public function index(){
	
	}
	//举报
	public function add(){
		$type=intval($_GET['type']);
		$type=($type>0)?$type:1;
		$content=$_POST['content'];
		
		$type_arr=$this->s_0->msg_type();
		
		$widget=load_service('a_widget',P_SVC);
		
		include($this->viewer_dir.'guestbook/guestbook.php');
	}
	public function add_(){
		if($_POST){
			if($_POST['captcha']!=$_SESSION['code']){
				alert('验证码不正确！');
				back();
			}
			$r=$this->s_0->add_($_POST);
			if($r[0]){
				alert('提交成功！');
				jump('guestbook','add','type='.$_POST['type']);
			}else{
				alert($r[1]);
				back();
			}
        }
	}
//
}